<?php
namespace Home\Model;
use Think\Model;
class ConditionModel extends Model {
    public function getConditionList($cond=null){
    	$res = M('condition')->join('compare on condition.condition_id = compare.compare_id')
    			->where($cond)
    		->select();
    	return $res;
    }
    
    public function insertConditionInfo($data){
    	if(!$data){
    		return false;
    	}
    	$res = M('condition')->add($data);
    	return $res;
    }
    
    public function getConditionInfo($cond){
    	if(!$cond){
    		return false;
    	}
    	$res = M('condition')->where($cond)
    		->find();
    	return $res;
    }
    
    public function reviseConditionInfo($cond,$data){
    	if(!$cond || !$data){
    		return false;
    	}
    	$res = M('condition')->where($cond)
    		->save($data);
    	return $res;
    
    	
    }
}